home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / RxMUI / Examples / AppWin.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2004-01-31  |  2.3 KB  |  81 lines

  1. /* APPEVENT example */
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. call init
  7. call CreateApp
  8. call HandleApp
  9. /* never reached */
  10. /***********************************************************************/
  11. init: procedure
  12.     l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  13.     if AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
  14.     return
  15. /***********************************************************************/
  16. handleApp: procedure
  17.     ctrl_c=2**12
  18.     do forever
  19.         call NewHandle("APP","H",ctrl_c)
  20.         if and(h.signals,ctrl_c)>0 then exit
  21.         select
  22.             when h.event="QUIT" then exit
  23.             when h.event="APPEVENT" then call appFun(h.to,h.name)
  24.             otherwise interpret h.event
  25.         end
  26.     end
  27.     /* never reached */
  28. /***********************************************************************/
  29. CreateApp: procedure
  30.  
  31.     app.Title="AppWindowExample"
  32.     app.Version="$VER: AppWindowExample 2.2 (25.1.2002)"
  33.     app.Copyright="©2002, alfie"
  34.     app.Author="alfie"
  35.     app.Description="AppWindowExample"
  36.     app.Base="RXMUIEXAMPLE"
  37.     app.SubWindow="win"
  38.      win.Title="AppWindowExample"
  39.      win.AppWindow=1
  40.      win.Contents="mgroup"
  41.       mgroup.frametitle="Drop icons on me!"
  42.       mgroup.0="droplist1"
  43.        droplist1.class="listview"
  44.        droplist1.input=1
  45.        droplist1.list="list"
  46.         list.frame="inputlist"
  47.       mgroup.1="droplist2"
  48.        droplist2.class="listview"
  49.        droplist2.input=1
  50.        droplist2.list="dlist"
  51.         dlist.class="dirlist"
  52.         dlist.frame="inputlist"
  53.  
  54.     res=NewObj("APPLICATION","APP")
  55.     if res~=0 then exit
  56.  
  57.     call Notify("win","closerequest",1,"app","returnid","quit")
  58.     call Notify("droplist1","entries","everytime","droplist1","jump","triggervalue")
  59.  
  60.     call AppMessage("droplist1")
  61.     call AppMessage("droplist2")
  62.     call set("app","DropObject","droplist1")
  63.  
  64.     call set("win","open",1)
  65.  
  66.     return
  67. /***********************************************************************/
  68. halt:
  69. break_c:
  70.     exit
  71. /**************************************************************************/
  72. appFun: procedure
  73. parse arg to,what
  74. say to what
  75.     if to="DROPLIST1" then call DoMethod(to,"insert",what,"bottom")
  76.     else call set("dlist","DIRECTORY",what)
  77.  
  78.     return
  79. /**************************************************************************/
  80.  
  81.